import Types from '../types';
import DataStore from '../../public/dao/DataStore';
import {handleData} from '../ActionUtil'
export function getBrowseList(storeName,data){
    return dispatch =>{
        dispatch({type: Types.BROWSE_LIST_REFRSH, storeName: storeName});
        let dataStore = new DataStore();
        dataStore.fetchData('/webservice/browse',data,'GET',`BroseList${data.category}`).then((json)=>{
            // handleData(Types.BROWSE_LIST_SUCCESS,dispatch,storeName,json,'browse');
            // console.log('klh',json)
        }).catch((err)=>{
            dispatch({
                type:Types.BROWSE_LIST_FAIL,
                storeName,
                err
            })
        })
    }
}